﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MainMaster.Master" AutoEventWireup="true"
    CodeBehind="MessageList.aspx.cs" Inherits="EDMS.SMS.MessageList" %>

<%@ Register Assembly="DevExpress.Web.ASPxGridView.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dx" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <title>短信记录查询</title>
    <link rel="stylesheet" href="css/css3-buttons.css" type="text/css" media="screen" />
    <link href='http://fonts.googleapis.com/css?family=PT+Sans' rel='stylesheet' type='text/css' />
    <link href='http://fonts.googleapis.com/css?family=Molengo' rel='stylesheet' type='text/css' />
    <link media="screen" rel="stylesheet" href="colorbox.css" />
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
    <script type="text/javascript" src="css/jquery.colorbox.js"></script>
    <!--DataRangePicker -->
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.7/jquery-ui.min.js"></script>
    <script type="text/javascript" src="../jQuery-UI-Date-Range-Picker/js/date.js"></script>
    <script type="text/javascript" src="../jQuery-UI-Date-Range-Picker/js/daterangepicker.jQuery.js"></script>
    <script type="text/javascript" src="../jQuery-UI-Date-Range-Picker/js/jquery.ui.datepicker-zh-CN.js"></script>
    <link rel="stylesheet" href="../jQuery-UI-Date-Range-Picker/css/ui.daterangepicker.css"
        type="text/css" />
    <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.7/themes/redmond/jquery-ui.css"
        type="text/css" />
    <!-- Using TipTip jQuery plugin for the tooltips -->
    <link rel="stylesheet" href="Styles/tiptip.css" type="text/css" media="screen" />
    <script type="text/javascript" src="Styles/jquery.tiptip.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {

            // Toggle the dropdown menu's
            $(".dropdown .button, .dropdown button").click(function () {
                // hide any open menus (Yuneekguy)
                $('.dropdown-slider').slideUp();
                $('span.toggle').removeClass('active');

                // open selected dropown
                $(this).parent().find('.dropdown-slider').slideToggle('fast');
                $(this).find('span.toggle').toggleClass('active');

                return false;
            });

            $('#<%= DateRange.ClientID %>').daterangepicker();
            //            $('#DateRange').daterangepicker();

            // Launch TipTip tooltip
            $('.tiptip a.button, .tiptip button').tipTip();

            //跳转到短信对话记录
            $("a[id*='dx']").colorbox({ width: "90%", height: "80%", iframe: true });

            //跳转到选民信息
            $("a[id*='xm']").colorbox({ width: "60%", height: "70%", iframe: true });

            //跳转到选举信息
            $("a[id*='xj']").colorbox({ width: "60%", height: "70%", iframe: true });
        });

        // Close open dropdown slider by clicking elsewhwere on page
        $(document).bind('click', function (e) {
            if (e.target.id != $('.dropdown').attr('class')) {
                $('.dropdown-slider').slideUp();
                $('span.toggle').removeClass('active');
            }
        });

        function CbMessage(para) {
            grid.PerformCallback(para);
        }

        function Clean() {
            document.getElementById("<%= DateRange.ClientID %>").value = "";
            document.getElementById("<%= TelePhone.ClientID %>").value = "";
        }

        function Reset() {

            // Launch TipTip tooltip
            $('.tiptip a.button, .tiptip button').tipTip();

            //跳转到短信对话记录
            $("a[id*='dx']").colorbox({ width: "80%", height: "80%", iframe: true });

            //跳转到选民信息
            $("a[id*='xm']").colorbox({ width: "60%", height: "70%", iframe: true });

            //跳转到选举信息
            $("a[id*='xj']").colorbox({ width: "60%", height: "70%", iframe: true });
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="rightpanel left">
        <h1>
            短信记录查询
        </h1>
        <div class="buttons">
            <div class="dropdown left">
                <a href="#" class="button left"><span class="icon icon55"></span><span id="SmsType"
                    class="label">短信类型</span><span class="toggle"></span></a>
                <div class="dropdown-slider">
                    <a href="javascript:CbMessage(-1)" class="ddm"><span class="icon icon68"></span><span
                        class="label">全部</span></a> <a href="javascript:CbMessage(0)" class="ddm"><span class="icon icon112">
                        </span><span class="label">系统通知</span></a> <a href="javascript:CbMessage(2)" class="ddm">
                            <span class="icon icon44"></span><span class="label">系统回复</span></a> <a href="javascript:CbMessage(3)"
                                class="ddm"><span class="icon icon177"></span><span class="label">委托</span></a>
                    <a href="javascript:CbMessage(4)" class="ddm"><span class="icon icon35"></span><span
                        class="label">取消委托</span></a> <a href="javascript:CbMessage(5)" class="ddm"><span
                            class="icon icon198"></span><span class="label">委托查询</span></a> <a href="javascript:CbMessage(6)"
                                class="ddm"><span class="icon icon56"></span><span class="label">系统异常</span></a>
                    <a href="javascript:CbMessage(1)" class="ddm"><span class="icon icon186"></span><span
                        class="label">忽略</span></a>
                </div>
            </div>
            <div class="dropdown right">
                <button class="right">
                    <span class="icon icon120"></span><span class="label">短信内容</span><span class="toggle"></span></button>
                <div class="dropdown-slider">
                    <a href="javascript:CbMessage(-2)" class="ddm"><span class="icon icon123"></span><span
                        class="label">显示</span></a> <a href="javascript:CbMessage(-3)" class="ddm"><span
                            class="icon icon122"></span><span class="label">隐藏</span></a>
                </div>
            </div>
            <table>
                <tr>
                    <td>
                        日期：
                    </td>
                    <td>
                        <input type="text" value="" runat="server" style="width: 180px; height: 2.1em; display: block;
                            font-size: 12px; font-family: @微软雅黑; font-weight: bold" id="DateRange" />
                    </td>
                    <td>
                        手机号码：
                    </td>
                    <td>
                        <input type="text" value="" runat="server" style="width: 180px; height: 2.1em; display: block;
                            font-size: 12px; font-family: @微软雅黑; font-weight: bold" id="TelePhone" />
                    </td>
                    <td>
                        <div class="tiptip">
                            <a href="javascript:CbMessage(-4)" class="button left" title="查询"><span class="icon icon198">
                            </span></a><a href="javascript:Clean()" class="button right" title="清空"><span class="icon icon83">
                            </span></a>
                        </div>
                    </td>
                </tr>
            </table>
        </div>
        <dx:ASPxGridView ID="gridView" runat="server" AutoGenerateColumns="False" KeyFieldName="jlbh"
            CssFilePath="~/App_Themes/DevEx/{0}/styles.css" ClientInstanceName="grid" CssPostfix="DevEx"
            Width="100%" OnCustomCallback="gridView_CustomCallback">
            <Settings ShowPreview="true" />
            <SettingsPager Position="TopAndBottom">
            </SettingsPager>
            <Columns>
                <dx:GridViewDataComboBoxColumn Name="t_flag" FieldName="flag" Width="50px" VisibleIndex="0"
                    CellStyle-HorizontalAlign="Right" Caption="类型">
                    <PropertiesComboBox ValueType="System.String" Spacing="0">
                        <Items>
                            <dx:ListEditItem ImageUrl="images/Notice.png" Text="通知" Value='0' />
                            <dx:ListEditItem ImageUrl="images/Reply.png" Text="回复" Value="2" />
                            <dx:ListEditItem ImageUrl="images/Delegate.png" Text="委托" Value="3" />
                            <dx:ListEditItem ImageUrl="images/Cancel.png" Text="取消" Value="4" />
                            <dx:ListEditItem ImageUrl="images/Query.png" Text="查询" Value="5" />
                            <dx:ListEditItem ImageUrl="images/Erro.png" Text="异常" Value="6" />
                            <dx:ListEditItem ImageUrl="images/Ignore.png" Text="忽略" Value="1" />
                        </Items>
                    </PropertiesComboBox>
                </dx:GridViewDataComboBoxColumn>
                <dx:GridViewDataTextColumn Name="t_jlbh" FieldName="jlbh" VisibleIndex="1" Width="30px"
                    CellStyle-HorizontalAlign="Center" Caption="序号">
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn Name="t_xjbh" FieldName="xjbh" VisibleIndex="2" CellStyle-HorizontalAlign="Left"
                    Caption="选举编号">
                    <DataItemTemplate>
                        <div class="tiptip">
                            <a href='Xjxx.aspx?Xjbh=<%#Eval("xjbh") %>' id="xj" class="button" title="选举信息"><span
                                class="icon icon105"></span><span class="label">
                                    <%#Eval("xjbh")%></span></a>
                        </div>
                    </DataItemTemplate>
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn Name="t_fssj" FieldName="fssj" VisibleIndex="3" CellStyle-HorizontalAlign="Left"
                    Caption="发生时间">
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn Name="t_bjhm" FieldName="bjhm" VisibleIndex="4" CellStyle-HorizontalAlign="Left"
                    Caption="从">
                    <DataItemTemplate>
                        <%#(Eval("bjhm").ToString() != BLL.SmsBLL.SMSCENTERNUMBER && BLL.SmsBLL.CheckXmByPhone(Eval("bjhm").ToString())) ?
                                                    string.Format("<div class=\"tiptip\"><a href=\"Xmxx.aspx?Phone={0}\" id=\"xm\" class=\"button\" title=\"选民信息\"><span class=\"icon icon4\"></span><span class=\"label\">{0}</span></a></div>", Eval("bjhm")) : Eval("bjhm")
                        %>
                        <%--                        <div class="tiptip">
                            <a href="#" id="xm" class="button" title="选民信息"><span class="icon icon4"></span><span
                                class="label">
                                <%#Eval("bjhm")%></span></a>
                        </div--%>
                    </DataItemTemplate>
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn Name="t_mbsjhm" FieldName="mbsjhm" VisibleIndex="5" CellStyle-HorizontalAlign="Left"
                    Caption="到">
                    <DataItemTemplate>
                        <%#(Eval("mbsjhm").ToString() != BLL.SmsBLL.SMSCENTERNUMBER) ?
                                                    string.Format("<div class=\"tiptip\"><a href=\"Xmxx.aspx?Phone={0}\" id=\"xm\" class=\"button\" title=\"选民信息\"><span class=\"icon icon4\"></span><span class=\"label\">{0}</span></a></div>", Eval("mbsjhm")) : Eval("mbsjhm")
                        %>
                        <%--                        <div class="tiptip">
                            <a href="#" id="xm" class="button" title="选民信息"><span class="icon icon4"></span><span
                                class="label">
                                <%#Eval("mbsjhm")%></span></a>
                        </div>--%>
                    </DataItemTemplate>
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn VisibleIndex="6" CellStyle-HorizontalAlign="Left" Caption="操作">
                    <DataItemTemplate>
                        <div class="tiptip">
                            <a href='Dialog.aspx?phone=<%# Eval("bjhm").Equals(BLL.SmsBLL.SMSCENTERNUMBER)?Eval("mbsjhm"):Eval("bjhm")                               
                            %>' id="dx" class="button on" title="聊天记录"><span class="icon icon125"></span></a>
                        </div>
                    </DataItemTemplate>
                </dx:GridViewDataTextColumn>
            </Columns>
            <Templates>
                <PreviewRow>
                    短信内容：<%# Eval("nr") %>
                </PreviewRow>
            </Templates>
            <Images SpriteCssFilePath="~/App_Themes/DevEx/{0}/sprite.css">
                <LoadingPanelOnStatusBar Url="~/App_Themes/DevEx/GridView/StatusBarLoading.gif">
                </LoadingPanelOnStatusBar>
                <LoadingPanel Url="~/App_Themes/DevEx/GridView/Loading.gif">
                </LoadingPanel>
            </Images>
            <ImagesFilterControl>
                <LoadingPanel Url="~/App_Themes/DevEx/GridView/Loading.gif">
                </LoadingPanel>
            </ImagesFilterControl>
            <Styles CssFilePath="~/App_Themes/DevEx/{0}/styles.css" CssPostfix="DevEx">
                <Header ImageSpacing="5px" SortingImageSpacing="5px">
                </Header>
                <LoadingPanel ImageSpacing="5px">
                </LoadingPanel>
            </Styles>
            <StylesEditors ButtonEditCellSpacing="0">
                <ProgressBar Height="21px">
                </ProgressBar>
            </StylesEditors>
            <ClientSideEvents EndCallback="function(s,e){Reset();}" />
        </dx:ASPxGridView>
    </div>
</asp:Content>
